package com.job.gaoyue.day0705;

import java.util.Scanner;

/**
 * @author ${高某}
 * @version 1.0
 * @since 2022-07-06 10:44:15
 */
public class kecheng {
    //上课的内容

    public static void main(String[] args) {
        //STN
        int S = 0, N = 0, T = 0;
        Scanner sc = new Scanner(System.in);//构建一个扫描器
        System.out.println("输入S");//输入S的值
        S = sc.nextInt();
        System.out.println("输入T");//输入T的值
        T = sc.nextInt();
        System.out.println("输入N");//输入N的值
        N = sc.nextInt();
        int num = S;//定义初始输入数据
        int[][] arr = new int[N][N];
        for (int i = 0; i <= N; i++) {//两个for循环，优先列，然后行
            for (int j = 0; j < N - i; j++) {
                arr[j][i] = num;
                num++;
                num=num>T?1:num;//判断当输入值等于最大值 T 时，返回初始值继续输入
            }
        }//打印结果
        for (int i=0;i<N;i++){
            for (int j=0;j<N-i;j++){
                System.out.print(arr[i][j]+"\t");
                if (j==N-i-1){
                    System.out.println("\t");
                }
            }
        }
    }
}